package CinemaDevelop;

import java.time.LocalDateTime;

public class Manager extends User {
    public Manager(String userName, String passWord, String telephoneNum) {
        super(userName, passWord, telephoneNum);
    }

    @Override
    public void login(String userName, String passWord) {
        if (userName.equals(super.userName) && passWord.equals(super.passWord)) {
            isLogged = true;
            System.out.println("登陆成功！经理：" + userName + ",欢迎您！");
        } else {
            System.out.println("用户名或密码错误！请重新登录。");
        }
    }

    @Override
    public void addMovie(Cinema cinema, MovieSchedule schedule) {
        if (isLogged) {
            CinemaDAO.addMovieSchedule(schedule);
            cinema.getMovieSchedules().add(schedule);
            System.out.println("排期添加成功！");
        } else {
            System.out.println("无权限，请先进行登录！");
        }
    }

    @Override
    public void removeMovie(Cinema cinema, MovieSchedule schedule) {
        if (isLogged) {
            CinemaDAO.removeMovieSchedule(schedule);
            cinema.getMovieSchedules().remove(schedule);
            System.out.println("排期删除成功！");
        } else {
            System.out.println("无权限，请先进行登录！");
        }
    }

    @Override
    public void setScreenRoom(Cinema cinema, ScreenRoom room) {
        System.out.println("经理无权限进行设置观影院操作！");
    }

    @Override
    public void showMovieCasted(Cinema cinema) {
        System.out.println("经理无权限进行获取排片列表操作！");
    }

    @Override
    public void findMovie(Cinema cinema, String movieName, String roomType) {
        System.out.println("经理无权限进行查找影片操作!");
    }

    @Override
    public void sellTicket(Cinema cinema, String movieName, String roomType,
                           LocalDateTime time, int row, int line, String inform) {
        System.out.println("经理无权限进行售票操作！");
    }
}
